/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.dao;

import java.util.List;

import com.sigmatrix.h5.dao.impl.common.BaseDao;
import com.sigmatrix.h5.entity.WarehouseStock;
import com.sigmatrix.h5.entity.WarehouseStockDetails;
import com.sigmatrix.h5.exception.DaoException;


/**
 *@ClassName: WarehouseStockDetailsDao
 *@Description: 库存详情数据库操作接口
 *@author youjun
 *@date 2017-06-14 10:18:54
 */
public interface WarehouseStockDetailsDao extends BaseDao<WarehouseStock> {

	/**
	 *@Title: findById
	 *@Description: 根据主键查找库存详情
	 *@return WarehouseStockDetails
	 *@author youjun
	 *@date 2017-06-14 10:18:54
	 *@param id
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException 
	 */
	WarehouseStockDetails findById(final Integer id, final String enterpriseCode) throws DaoException;
	
	/**
	 *@Title: save
	 *@Description: 保存库存详情
	 *@return int
	 *@author youjun
	 *@date 2017-06-14 10:18:54
	 *@param warehouseStockDetails
	 *@return
	 *@throws DaoException 
	 */
	int save(final WarehouseStockDetails warehouseStockDetails, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: update
	 *@Description: 更新库存详情
	 *@return int
	 *@author youjun
	 *@date 2017-06-14 10:18:54
	 *@param warehouseStockDetails
	 *@return
	 *@throws DaoException 
	 */
	int update(final WarehouseStockDetails warehouseStockDetails, final String enterpriseCode) throws DaoException;
	
	/**
	 *@Title: findListByCondition
	 *@Description: 根据条件查找库存详情列表
	 *@return List<WarehouseStockDetails>
	 *@author youjun
	 *@date 2017-06-14 10:18:54
	 *@param warehouseStockDetails
	 *@return
	 *@throws DaoException
	 */
	List<WarehouseStockDetails> findListByCondition(final WarehouseStockDetails warehouseStockDetails, final String enterpriseCode) throws DaoException;

	/**
	 *@Title: countByStockId
	 *@Description: 统计数量
	 *@return Integer
	 *@date 2017年9月28日 下午7:38:54
	 *@param eseCode
	 *@param stockId  主库存单Id
	 */
	Integer countByStockId(final String eseCode,final Long stockId,final Short status);
	
	/**
	 *@Title: countByCondition
	 *@Description:查询码在当前库存中的数量
	 *@return Integer
	 *@date 2017年10月12日 下午7:07:34
	 *@param eseCode
	 *@param warehosueId
	 *@param productId
	 *@param code
	 */
	Integer countByCondition(final String eseCode,final Integer warehosueId,final Integer productId,final String code,final Short status,final boolean isflag);
	/**
	 * 
	 *@Title: findByCondition
	 *@Description: TODO()
	 *@return List<WarehouseStockDetails>
	 *@author gaomingkai
	 *@date 2017年11月24日 下午5:14:23
	 *@param eseCode
	 *@param warehosueId
	 *@param productId
	 *@param code
	 *@param status
	 *@param isflag
	 *@return
	 */
	List<WarehouseStockDetails> findByCondition(final String eseCode,final Integer warehosueId,final Integer productId,final String code,final Short status);
	
	/**
	 *@Title: batchSave
	 *@Description: 批量更新库存
	 *@return void
	 *@author youjun
	 *@date 2017年8月27日 下午9:14:37
	 *@param warehouseStockDetailsList
	 *@param enterpriseCode
	 * @throws DaoException 
	 */
	int batchSave(List<WarehouseStockDetails> warehouseStockDetailsList, String enterpriseCode) throws DaoException;

	/**
	 *@Title: batchUpdateStatus
	 *@Description: 批量更新状态
	 *@return int
	 *@author youjun
	 *@date 2017年8月28日 下午5:11:04
	 *@param stockId
	 *@param batchBoxList
	 *@param updateStatus 更新成的状态
	 *@param enterpriseCode
	 *@throws DaoException 
	 */
	int batchUpdateStatus(Long stockId, List<String> batchBoxList, short updateStatus,
			String enterpriseCode) throws DaoException;
	/**
	 * 
	 *@Title: updateStatus
	 *@Description: TODO()
	 *@return int
	 *@author gaomingkai
	 *@date 2018年1月26日 下午1:03:47
	 *@param stockId
	 *@param code
	 *@param updateStatus
	 *@param enterpriseCode
	 *@return
	 *@throws DaoException
	 */
	int updateStatus(Long stockId, String code, short updateStatus,
			String enterpriseCode) throws DaoException;

	/**
	 * 
	 *@Title: countByCondition
	 *@Description:校验码是否已出库
	 *@return Integer
	 *@author gaomingkai
	 *@date 2017年10月31日 下午11:15:44
	 *@param eseCode
	 *@param warehosueId
	 *@param productId
	 *@param code
	 *@param stauts
	 *@return
	 */
	Integer countByConditionOut(final String eseCode,final Integer warehosueId,final Integer productId,final String code, int stauts,final boolean isflag);
	/**
	 * 
	 *@Title: findByConditionOut
	 *@Description: TODO()
	 *@return List<WarehouseStockDetails>
	 *@author gaomingkai
	 *@date 2017年11月24日 下午5:38:07
	 *@param eseCode
	 *@param warehosueId
	 *@param productId
	 *@param code
	 *@param stauts
	 *@return
	 */
	List<WarehouseStockDetails> findByConditionOut(final String eseCode,final Integer warehosueId,final Integer productId,final String code, int stauts);

	/**
	 * 
	 *@Title: countByCode
	 *@Description: TODO()
	 *@return Integer
	 *@author gaomingkai
	 *@date 2017年12月27日 上午11:15:41
	 *@param eseCode
	 *@param code
	 *@return
	 */
	Integer countByCode(final String eseCode,final String code);
}
